
Namespace Validation

    Public Class CompareValueRuleEventArgs
        Inherits RuleEventArgs

#Region " Declarations "

        Private _enumComparisonType As ComparisonType = ComparisonType.Equal
        Private _enumRequiredEntry As RequiredEntry = RequiredEntry.No
        Private _objCompareToValue As IComparable

#End Region

#Region " Properties "

        Public Property CompareToValue() As IComparable
            Get
                Return _objCompareToValue
            End Get
            Set(ByVal Value As IComparable)
                _objCompareToValue = Value
            End Set
        End Property

        Public Property ComparisonType() As ComparisonType
            Get
                Return _enumComparisonType
            End Get
            Set(ByVal Value As ComparisonType)
                _enumComparisonType = Value
            End Set
        End Property

        Public Property RequiredEntry() As RequiredEntry
            Get
                Return _enumRequiredEntry
            End Get
            Set(ByVal Value As RequiredEntry)
                _enumRequiredEntry = Value
            End Set
        End Property

#End Region

#Region " Constructor "

        Public Sub New(ByVal e As CompareValueValidatorAttribute, ByVal strPropertyName As String)
            MyBase.New(strPropertyName, e.PropertyFriendlyName, e.RuleSet, e.CustomMessage)
            _enumComparisonType = e.ComparisonType
            _objCompareToValue = e.CompareToValue
            _enumRequiredEntry = e.RequiredEntry
        End Sub

        Public Sub New(ByVal enumComparisonType As ComparisonType, ByVal enumRequiredEntry As RequiredEntry, ByVal objCompareToValue As IComparable, ByVal strCustomMessage As String, ByVal strPropertyFriendlyName As String, ByVal strPropertyName As String, ByVal strRuleSet As String)
            MyBase.New(strPropertyName, strPropertyFriendlyName, strRuleSet, strCustomMessage)
            _enumComparisonType = enumComparisonType
            _objCompareToValue = objCompareToValue
            _enumRequiredEntry = enumRequiredEntry
        End Sub

#End Region

    End Class

End Namespace
